/* events-styles.css - 双层布局 */
.events-content {
    padding: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.data-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
}

.data-actions {
    display: flex;
    gap: 6px;
}

.data-action-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
}

.events-list {
    flex: 1;
    overflow-y: auto;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid var(--border-color);
}

/* 事件项样式 - 双层布局 */
.event-item {
    padding: 0;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* 左侧颜色标识 */
.event-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-blue);
}

.event-item.event-move::before {
    background: var(--accent-green);
}

.event-item.event-detection::before {
    background: var(--accent-orange);
}

.event-item.event-error::before {
    background: var(--accent-red);
}

/* 上层：消息和类型 */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 6px 12px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid var(--border-color);
}

.event-message-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.event-message {
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-type {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.event-type.move {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.event-type.detection {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
}

.event-type.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* 下层：数据预览 */
.event-data {
    padding: 4px 8px;
    background: rgba(15, 23, 42, 0.6);
    font-family: monospace;
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    max-height: 16px;
    min-height: 16px;
    display: flex;
    align-items: center;
    cursor: help;
}

.data-preview {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 数据提示框 */
.data-tooltip {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 400px;
    max-height: 300px;
    backdrop-filter: blur(10px);
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.tooltip-expand {
    padding: 2px 6px;
    border: 1px solid var(--accent-blue);
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 9px;
}

.tooltip-expand:hover {
    background: rgba(59, 130, 246, 0.3);
}

.tooltip-data {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
    padding: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    margin: 0;
}

/* 事件详情模态框 */
.event-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.event-detail-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.event-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.8);
}

.event-detail-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.event-detail-body {
    padding: 16px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.detail-section {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
}

.detail-section.full-width {
    flex-direction: column;
    align-items: stretch;
}

.detail-section label {
    font-weight: 600;
    color: var(--text-secondary);
    width: 80px;
    flex-shrink: 0;
    font-size: 12px;
    margin-right: 12px;
    margin-bottom: 4px;
}

.detail-section.full-width label {
    width: 100%;
    margin-bottom: 8px;
}

.detail-section span {
    color: var(--text-primary);
    font-size: 12px;
    flex: 1;
}

.event-detail-data {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
    flex: 1;
}

.event-detail-data.preview {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(59, 130, 246, 0.3);
}

/* 无数据时隐藏下层 */
.event-item:not(:has(.event-data)) .event-header {
    border-bottom: none;
}

/* 滚动条样式 */
.events-list::-webkit-scrollbar,
.event-detail-data::-webkit-scrollbar,
.tooltip-data::-webkit-scrollbar {
    width: 4px;
}

.events-list::-webkit-scrollbar-track,
.event-detail-data::-webkit-scrollbar-track,
.tooltip-data::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
}

.events-list::-webkit-scrollbar-thumb,
.event-detail-data::-webkit-scrollbar-thumb,
.tooltip-data::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 2px;
}

/* 无事件提示 */
.no-events {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
}


/* 数据提示框 - 修复滚动问题 */
.data-tooltip {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 500px;
    max-height: 400px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    /* 确保可以交互 */
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    /* 防止头部被压缩 */
}

.tooltip-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.tooltip-expand {
    padding: 2px 6px;
    border: 1px solid var(--accent-blue);
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 9px;
    flex-shrink: 0;
}

.tooltip-expand:hover {
    background: rgba(59, 130, 246, 0.3);
}

.tooltip-data {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
    padding: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
    margin: 0;
    flex: 1;
    /* 占据剩余空间 */
    min-height: 100px;
    max-height: 300px;
}

/* 确保工具提示滚动条有足够点击区域 */
.tooltip-data::-webkit-scrollbar {
    width: 8px;
}

.tooltip-data::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

.tooltip-data::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

.tooltip-data::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* 事件数据区域的悬停效果 */
.event-data {
    padding: 4px 8px;
    background: rgba(15, 23, 42, 0.6);
    font-family: monospace;
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    max-height: 16px;
    min-height: 16px;
    display: flex;
    align-items: center;
    cursor: help;
    position: relative;
}

/* 添加一个小三角形指示器 */
.event-data:hover::after {
    content: '🔼';
    position: absolute;
    right: 4px;
    font-size: 8px;
    opacity: 0.6;
}